/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import com.opensymphony.xwork2.ActionSupport;
import java.util.ArrayList;
import thesis.haipv.qa.model.Answer;
import thesis.haipv.qa.model.UserProfile;
import thesis.haipv.qa.persistence.AnswerDAO;
import thesis.haipv.qa.persistence.FeedbackDAO;
import thesis.haipv.qa.persistence.UserProfileDAO;

/**
 *
 * @author PHANHAI
 */
public class GetAnswerByUser extends ActionSupport {
    
    private String userId;
    private ArrayList<Answer> answers;
    private UserProfile user;
            
    @Override
    public String execute() throws Exception {  
       AnswerDAO dao = new AnswerDAO();
       answers = dao.getAnswersByUser(userId);
       user = new UserProfileDAO().getProfile(userId);
       return SUCCESS;
    }

    public ArrayList<Answer> getAnswers() {
        return answers;
    }

    public void setAnswers(ArrayList<Answer> answers) {
        this.answers = answers;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public UserProfile getUser() {
        return user;
    }

    public void setUser(UserProfile user) {
        this.user = user;
    }
    
    
    
}
